import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

//vue components
//home
import mtHome from '@/components/Home/Home'

//goods
import mtGoodsList from '@/components/Goods/Goods'
import mtGoodsDetail from '@/components/Goods/Detail'

//cart
import mtGoodsCart from '@/components/Cart/Cart'

//user
import mtUser from '@/components/User/User'
import mtUserCollections from '@/components/User/Collection'

//Account
import Login from '@/components/Account/Login'
import Register from '@/components/Account/Register'
import ForgetPwd from '@/components/Account/ForgetPwd'

export default new Router({
  mode: "hash",
  routes: [{
      path: '/',
      name: 'mtHome',
      component: mtHome,
      meta: {
        tab: 1,
        title: '首页',
        head: true,
        foot: true,
        back: false
      }
    },
    {
      path: '/goodsList',
      name: 'goodsList',
      component: mtGoodsList,
      meta: {
        tab: 2,
        title: '商品列表',
        head: true,
        foot: true,
        back: true
      }
    },
    {
      path: '/goodsDetail/:gid',
      name: 'goodsDetail',
      component: mtGoodsDetail,
      meta: {
        tab: 2,
        title: '商品详情',
        head: true,
        foot: false,
        back: true
      }
    },
    {
      path: '/goodsCart',
      name: 'goodsCart',
      component: mtGoodsCart,
      meta: {
        tab: 3,
        title: '购物车',
        head: true,
        foot: true,
        back: true
      }
    },
    {
      path: '/user',
      name: 'user',
      component: mtUser,
      meta: {
        tab: 4,
        title: '个人中心',
        head: false,
        foot: true,
        back: false
      }
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
      meta: 　{
        tab: 5,
        title: '登录',
        head: true,
        foot: false,
        back: true
      }
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
      meta: 　{
        tab: 5,
        title: '注册',
        head: true,
        foot: false,
        back: true
      }
    },
    {
      path: '/forgetpwd',
      name: 'forgetpwd',
      component: ForgetPwd,
      meta: 　{
        tab: 5,
        title: '忘记密码',
        head: true,
        foot: false,
        back: true
      }
    },
    {
      path: '/userCollections',
      name: 'userCollections',
      component: mtUserCollections,
      meta: 　{
        tab: 5,
        title: '收藏中心',
        head: true,
        foot: false,
        back: true
      }
    }
  ]
})